﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using LanCustomControldll;
using FinalTestMachine.Motion;

namespace FinalTestMachine.View.MainUnits
{
    /// <summary>
    /// Unit_MainTopPart.xaml 的交互逻辑
    /// </summary>
    public partial class Unit_MainTopPart : UserControl, IShow
    {
        public Unit_MainTopPart()
        {
            InitializeComponent();
            this.btnClear.Click += (sender, args) => uc_Product.ClearProduction();
            IUserLimitdll.PreControlBindingHelper.SetLitmitBinding(btnClear, IUserLimitdll.UserLevelModes.ModifyAndOperation);
        }

        public void ShowUI()
        {
            uc_Product.ShowUI();
            uc_typeName.ShowUI();
            //uc_StationNGInfo.ShowUI();
            tb_uph.Text = StaticInitial.uPHHelper.UPH.ToString();
        }

        private void btnDetail_Click(object sender, RoutedEventArgs e)
        {
            Statictis.Wnd_Statistics wnd_Statistics = new Statictis.Wnd_Statistics();
            wnd_Statistics.Content = new AviewMotionUI.Views.ProductionStatistics.UCProductionStatistics();
            wnd_Statistics.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            wnd_Statistics.ShowDialog();
        }
    }
}